package com.xie.dome.searchservice.config;

/**
 * 自定义数据源切换类
 * @author xie
 */
public class DatabaseContextHolder {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void setDataBaseKey(String dataSourceKey) {
        contextHolder.set(dataSourceKey);
    }

    public static String getDataBaseKey() {
        return contextHolder.get();
    }

    public static void clearDataBaseKey() {
        contextHolder.remove();
    }
}
